Explanation:

ev.getValue() returns information about the event itself. In this case,

We check for this because if we don't, our event handler would get called twice -- once when the user presses down, and once when the user lets go. If it is a typical mouse click, the two events would come in rapid succession and in our world, nothing would appear to change!